#include <cstdio>
#include <algorithm>
#include <set>
using std::set;
using std::sort;

int n = 0;
int d[101] = {0};
int res = 0;
set<int> s;

int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n; ++i)
    {
        scanf("%d", d + i);
    }
    sort(d, d + n);
    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; j < i; ++j)
        {
            s.insert(d[i] + d[j]);
        }
    }
    for (int i = 0; i < n; ++i)
    {
        res += s.count(d[i]);
    }
    printf("%d", res);
    return 0;
}